package com.ruoyi.module.promotionrecord.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.module.promotionrecord.mapper.BizPromotionRecordMapper;
import com.ruoyi.module.promotionrecord.domain.BizPromotionRecord;
import com.ruoyi.module.promotionrecord.service.IBizPromotionRecordService;

/**
 * 推广记录Service业务层处理
 * 
 * @author zhaoxi
 * @date 2023-09-08
 */
@Service
public class BizPromotionRecordServiceImpl implements IBizPromotionRecordService 
{
    @Autowired
    private BizPromotionRecordMapper bizPromotionRecordMapper;

    /**
     * 查询推广记录
     * 
     * @param id 推广记录主键
     * @return 推广记录
     */
    @Override
    public BizPromotionRecord selectBizPromotionRecordById(Long id)
    {
        return bizPromotionRecordMapper.selectBizPromotionRecordById(id);
    }

    /**
     * 查询推广记录列表
     * 
     * @param bizPromotionRecord 推广记录
     * @return 推广记录
     */
    @Override
    public List<BizPromotionRecord> selectBizPromotionRecordList(BizPromotionRecord bizPromotionRecord)
    {
        return bizPromotionRecordMapper.selectBizPromotionRecordList(bizPromotionRecord);
    }

    /**
     * 新增推广记录
     * 
     * @param bizPromotionRecord 推广记录
     * @return 结果
     */
    @Override
    public int insertBizPromotionRecord(BizPromotionRecord bizPromotionRecord)
    {
        bizPromotionRecord.setCreateTime(DateUtils.getNowDate());
        return bizPromotionRecordMapper.insertBizPromotionRecord(bizPromotionRecord);
    }

    /**
     * 修改推广记录
     * 
     * @param bizPromotionRecord 推广记录
     * @return 结果
     */
    @Override
    public int updateBizPromotionRecord(BizPromotionRecord bizPromotionRecord)
    {
        bizPromotionRecord.setUpdateTime(DateUtils.getNowDate());
        return bizPromotionRecordMapper.updateBizPromotionRecord(bizPromotionRecord);
    }

    /**
     * 批量删除推广记录
     * 
     * @param ids 需要删除的推广记录主键
     * @return 结果
     */
    @Override
    public int deleteBizPromotionRecordByIds(Long[] ids)
    {
        return bizPromotionRecordMapper.deleteBizPromotionRecordByIds(ids);
    }

    /**
     * 删除推广记录信息
     * 
     * @param id 推广记录主键
     * @return 结果
     */
    @Override
    public int deleteBizPromotionRecordById(Long id)
    {
        return bizPromotionRecordMapper.deleteBizPromotionRecordById(id);
    }
}
